<?php

App::uses('Mysql', 'Model/Datasource/Database');

/**
 * MySQL DBO driver object
 *
 * Provides connection and SQL generation for MySQL RDMS
 *
 * @package       Cake.Model.Datasource.Database
 */
class MysqlLog extends Mysql {

	protected function _execute($sql, $params = array(), $prepareOptions = array()) {
		try {
			if (Configure::read('debug') >= 2) {
				// CakeLog::write(LOG_NOTICE, Debugger::trace());
				CakeLog::write(LOG_NOTICE, $sql);
			}
			$ret = parent::_execute($sql, $params, $prepareOptions);
			return $ret;
		} catch (exception $e) {
			CakeLog::write(LOG_ERR, $sql);
			throw $e;
		}
	}

}


?>